package ar.com.unlp.fi.lrs.persist;

import java.util.List;

import org.springframework.stereotype.Repository;

import ar.com.unlp.fi.lrs.domain.Verb;

//@Repository
public class VerbDao  extends AbstractDao{

	
	public Verb get(long id) {
		session = HibernateUtil.getSessionFactory().openSession();
		Verb verb = (Verb) session.get(Verb.class, id);
		tx = session.getTransaction();
		session.beginTransaction();
		tx.commit();
		return verb;
	}

	public List<Verb> getAll() {
		  session = HibernateUtil.getSessionFactory().openSession();  
		  tx = session.beginTransaction();  
		  List<Verb> verbs = session.createCriteria(Verb.class).list();  
		  tx.commit();  
		  session.close();  
		  return verbs;  
	}

	
	
	
}
